#ifndef __M_AVPLAYER_H__
#define __M_AVPLAYER_H__

#include <stdint.h>

#include <vita2d.h>

#include "file.h"

#define AVPLAYER_CONFIG_VERSION 1

enum DisplayMode
{
    DISPLAY_PRESERVE_FILL,
    DISPLAY_FULL_FILL,
};

enum PlayMode
{
    PLAY_MODE_SINGLE,
    PLAY_MODE_SEQUENTIAL,
    PLAY_MODE_LOOP_SINGLE,
    PLAY_MODE_LOOP_ALL,
};

typedef struct
{
    uint32_t version;            // 0x00
    uint32_t display_mode;       // 0x04
    char reserved[0x60];         // 0x08
} AvplayerConfig;                // 0x68

vita2d_texture *AvPlayerGetVideoTexture();

int AvplayerInit();
void AvplayerTerm();
int AvplayerOpen(char *path, int looping);
void AvplayerClose();
void AvplayerRun();

int AvplayerPlay(char *path, int looping);
int AvplayerPlayWithFileList(FileList *list, char *name, int play_mode);

int AvplayerIsPlaying();
int AvplayerPause();
int AvplayerResume();
int AvplayerStop();

uint64_t avplayerGetCurrentTime();
int AvplayerJumpToTime(int64_t timing);
int AvplayerGetTrickSpeed();
int AvplayerSetTrickSpeed(int spead);
int AvplayerGetVol();
void AvplayerSetVol(int vol);

#endif